//
//  AppDelegate.swift
//  阿酷微博
//
//  Created by co on 16/3/10.
//  Copyright © 2016年 王南侠. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
        // 设置外观一定要早
        setupAppearance()
        
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        
        // 设置背景控制器
        window?.backgroundColor = UIColor.whiteColor()
        // 设置根控制器
        window?.rootViewController = MainViewController()
        // 显示主窗口
        window?.makeKeyAndVisible()
        
        return true
    }

}

extension AppDelegate {
    
   /// 设置全局外观，一旦设置全局有效
    private func  setupAppearance() {
        UINavigationBar.appearance().tintColor = CZAppearanceTintColor
        UITabBar.appearance().tintColor = CZAppearanceTintColor
        
        // 设置导航栏标题字体
//        UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont.systemFontOfSize(17)]

        UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName:UIFont.systemFontOfSize(17)]
    }
    
}
